package com.sweetguy.entity;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 *  实体类。
 *
 * @author SweetGuy
 * @since 2024-12-22
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(value = "category", schema = "ml_cms")
public class Category implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键,自增
     */
    @Id(keyType = KeyType.Auto)
    private Long id;

    /**
     * 标题,非空
     */
    private String title;

    /**
     * 序号,非空
     */
    private Long idx;

    /**
     * 描述,非空
     */
    private String info;

    /**
     * 数据版本，非空，默认值为0
     */
    @Column(version = true)
    private Long version;

    /**
     * 逻辑删除标记，非空，默认值为0表示未删除，1表示已删除
     */
    @Column(isLogicDelete = true)
    private Integer deleted;

    /**
     * 创建时间，非空，默认为当前时间
     */
    private LocalDateTime created;

    /**
     * 更新时间，非空，默认为当前时间，记录更新时自动修改
     */
    private LocalDateTime updated;

}
